Websydian v6.1 online documentationOnline documentation - Websydian v6.5

EventHandlerWithValidation Function

The EventHandlerWithValidation pattern calls validation functions specified in the CA Plex model.  In this way, the Event Handler functions in Websydian will validate input in the same way as the maintenance functions in the EditDialog.EditSuite library pattern .

EventHandlerWithValidation with validation uses the library function patterns Meta.ValidateFields, Meta.ValidateFieldRelations, Meta.ValidateView, and Meta.ValidateEntityRelations functions which will call functions specified by the FLD validated by FNC, REL validated by FNC, VW validated by FNC, and ENT checked by FNC triples.  The validation functionality will also check for mandatory fields and relations.

If errors are found, the WsyBase<InstanceValid> field is set to *No and the errors found are reported by calling the subroutine Send message which further calls the service function InsertErrorMessageInList.  It is now up to the developer to react on the WsyBase<InstanceValid> field and the non-empty Message List.  This functionality is implemented in the Insert and Update Event Handler functions scoped by the WebEditDialog pattern in the Utility module.

If all of the validations mentioned above should be performed, the fields in the WebInput variable must also be specified by a FNC local VW triple.  If the fields are only specified by FNC local FLD triples, only the field validation will be performed.  To enable the relation validations, it is also necessary to specify the contents of the TargetRelations variable.